using UnityEngine;
using System.Collections;

public class CameraZoneViewState : State<CameraControl> 
{
	#region Singleton

    private static CameraZoneViewState instance = new CameraZoneViewState();
    public static CameraZoneViewState Instance { get { return instance; } }
    private CameraZoneViewState() { }

    #endregion

    #region State

    public override void OnEnter(CameraControl behaviour)
    {
        //Debug.Log ("ZoneView");
    }

    public override void OnUpdate(CameraControl behaviour)
    {
        behaviour.currentTargetDistance = behaviour.viewDelimiter.newVPPosition + behaviour.zoneViewDistance;
		behaviour.moveDistance = behaviour.CalculateMoveDistance(behaviour.currentTargetDistance);
		behaviour.Move(behaviour.moveDistance, behaviour.currentTargetDistance);
		
        // Final Tasks
        behaviour.targetDistance = behaviour.currentTargetDistance;
		behaviour.mainCamera.transform.eulerAngles = behaviour.camRotation;
		
    }

    public override void OnExit(CameraControl behaviour)
    {
		
    }

    public override void OnAction(string name, CameraControl behaviour, object value)
    {
		
    }

    #endregion
}